<?php

include_once($cfgPaths['lib'].'cms/type/cmsEditType.o.inc.php');

class cmsEditDateType extends cmsEditType {

 function registerFields () {
   $map[] = $this->name.'day';
   $map[] = $this->name.'month';
   $map[] = $this->name.'year';
   $map[] = $this->name.'daystr';
   $map[] = $this->name.'monthstr';
   $this->map = &$map;
 }

 function render_html () {
  $html  = '<div class="xicstypeplugin">'."\n";
  $html .= '    <h3>'.$this->descr.':</h3>'.$this->showFields()."\n";
  $html .= ' <table border="0">'."\n";
  $html .= '   <tr>'."\n";
  $html .= '     <td width="100">'."\n";
  $html .= '      Datum:</td>'."\n";
  $html .= '     <td>'."\n";
  $html .= '       <select name="'.$this->name.'day" tabindex="'.$this->sender->getNextTabindex($this->name.'day').'">'."\n";
       for ($i=1;$i<32;$i++) {
         $html .= '<option';
         if (((int)$this->getValue($this->name.'day'))==$i) $html .= ' selected="selected"';
         $html .= ">".($i<10?'0'.$i:$i)."</option>\n";
       }
       $html .= '</select> :'."\n";
       $html .= '<select name="'.$this->name.'month" tabindex="'.$this->sender->getNextTabindex($this->name.'month').'">'."\n";
       for ($i=1;$i<13;$i++) {
         $html .= '<option';
         if (((int)$this->getValue($this->name.'month'))==$i) $html .= ' selected="selected"';
         $html .= ">".($i<10?'0'.$i:$i)."</option>\n";
       }
       $html .= "</select> :\n";
       $html .= '<select name="'.$this->name.'year" tabindex="'.$this->sender->getNextTabindex($this->name.'year').'">';
       for ($i=1920;$i<2020;$i++) {
         $html .= '<option';
         if (((int)$this->getValue($this->name.'year'))==$i) $html .= ' selected="selected"';
         $html .= ">".($i<10?'0'.$i:$i)."</option>\n";
       }
  $html .= '       </select></td>'."\n";
  $html .= '   </tr>'."\n";
  $html .= '   <tr>'."\n";
  $html .= '     <td>'."\n";
  $html .= '       Wochentag:</td>'."\n";
  $html .= '     <td>'."\n";
  $html .= '       <input name="'.$this->name.'daystr" tabindex="'.$this->sender->getNextTabindex($this->name.'daystr').'" value="'.htmlspecialchars($this->getValue($this->name.'daystr')).'" size="30" maxlength="50"></td>'."\n";
  $html .= '   </tr>'."\n";
  $html .= '   <tr>'."\n";
  $html .= '     <td>'."\n";
  $html .= '       Monat:</td>'."\n";
  $html .= '     <td>'."\n";
  $html .= '       <input name="'.$this->name.'monthstr" tabindex="'.$this->sender->getNextTabindex($this->name.'monthstr').'" value="'.htmlspecialchars($this->getValue($this->name.'monthstr')).'" size="30" maxlength="50"></td>'."\n";
  $html .= '   </tr>'."\n";
  $html .= ' </table>'."\n";
  $html  .= '</div><!-- / type date -->'."\n";
  return $html;
 }

 function render_javascript () {
 }

}


?>